<?php

$file = file_get_contents(__DIR__.'/dump/istat-backup.json');
$decode = json_decode($file);

$data = array();
foreach ($decode as $city) {
	if (!isset($data[$city->citta])) {
		if ($city->geo[0])
		{
			$data[$city->citta] = $city->geo;
		}
	}
}

$handle = fopen(__DIR__.'/cities.txt', 'a');
fwrite($handle, json_encode($data));
fclose($handle);
